<template>
  <div>
    <h2>home</h2>
    cart模块中的num
    <button @click="addNum">cart模块的+</button>
    {{ $store.state.cart.num }}
    <hr>
    order里面的num
    {{ $store.state.order.num }}
    <br>
    order中的getter
    {{ $store.getters['order/doubleNum'] }}
  </div>
</template>

<script>
export default {
  methods: {
    addNum () {
      this.$store.commit('cart/ADD_NUM', 10)
    }
  },
  mounted () {
    console.log(this.$store)
  }
}

</script>

<style lang="scss" scoped>

</style>
